package com.yili.oa.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

//    @Autowired
//    private UserService userService;

//    @Autowired
//    MyInterceptor myInterceptor;

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        //myInterceptor.
//        registry.addInterceptor(myInterceptor).addPathPatterns("/temp/**").addPathPatterns("/tempApi/**");
//    }

//    @Bean
//    public FilterRegistrationBean myFilter(){
//        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
//        MyFilter myFilter = new MyFilter();
//        myFilter.setUserService(userService);
//        List<String> urls = new ArrayList<>();
//        urls.add("/temp/*");
//        urls.add("/tempApi/*");
//        filterRegistrationBean.setFilter(myFilter);
//        filterRegistrationBean.setUrlPatterns(urls);
//        return filterRegistrationBean;
//    }
}
